<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;
use module\index\middleware\Auth;

Route::domain('mini', function(){
    Route::get('home', 'Index/index'); // 首页
    Route::post('login', 'Visitor/login'); //用户登录限制频率,防止暴力破解
    Route::resource('help', 'Help')->only(['read']); // 帮助视图
    Route::resource('teacher', 'Teacher')->only(['index', 'read']);
    Route::resource('activity', 'Activity')->only(['index', 'read']);
    Route::resource('album', 'Album')->only(['index', 'read']);
    
    Route::group(function () {
        Route::put('notice/status', 'Notice/status'); // 消息置为已读
        Route::resource('notice', 'Notice')->only(['index']); // 消息通知
        Route::resource('pay', 'Pay')->except(['create', 'edit']); // 支付
        Route::put('address/default/:id', 'Address/default'); // 设置默认收货地址
        Route::resource('address', 'Address')->except(['create', 'edit']); // 收货地址
        Route::resource('feedback', 'Feedback')->only(['index', 'save', 'delete']);  // 实名认证
        Route::resource('signin', 'Signin')->only(['index', 'save']); // 签到
        Route::resource('favorite', 'Focus')->only(['index', 'save', 'delete']); // 收藏
        Route::resource('user-activity', 'UserActivity')->only(['index', 'read']);
        Route::resource('learn-log', 'UserLearnLog')->only(['save']);
        Route::resource('coupon', 'Coupon')->only(['index', 'save']); // 优惠券
        Route::get('order/checkout', 'Order/checkout'); // 订单
        Route::resource('order', 'Order')->except(['create', 'edit']); // 订单
    })->middleware(Auth::class);
})->prefix('\module\index\controller\\')->middleware('format');

